package org.creativor.rayson.transport.server.transfer;

import static org.junit.Assert.assertNotNull;
import org.creativor.rayson.api.TransferSocket;
import org.creativor.rayson.demo.proxy.DemoTransferArgument;
import org.creativor.rayson.demo.server.DemoTransferService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>CallManagerTest</code> contains tests for the class <code>{@link CallManager}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 *
 * @generatedBy CodePro at 11-5-7 上午2:46
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class CallManagerTest {
	/**
	 * Run the CallManager() constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Test
	public void testCallManager_1()
		throws Exception {

		CallManager result = new CallManager();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the void put(TransferCall) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Test
	public void testPut_1()
		throws Exception {
		CallManager fixture = new CallManager();
		TransferCall call = new TransferCall(new TransferInvoker((short) 1, new DemoTransferService(), Object.class.getMethods()[0]), new DemoTransferArgument(""), (TransferSocket) null);

		fixture.put(call);

		// TODO: add additional test code here
	}

	/**
	 * Run the void put(TransferCall) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Test
	public void testPut_2()
		throws Exception {
		CallManager fixture = new CallManager();
		TransferCall call = new TransferCall(new TransferInvoker((short) 1, new DemoTransferService(), Object.class.getMethods()[0]), new DemoTransferArgument(""), (TransferSocket) null);

		fixture.put(call);

		// TODO: add additional test code here
	}

	/**
	 * Run the TransferCall take() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Test
	public void testTake_1()
		throws Exception {
		CallManager fixture = new CallManager();

		TransferCall result = fixture.take();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the TransferCall take() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Test(expected = java.lang.InterruptedException.class)
	public void testTake_2()
		throws Exception {
		CallManager fixture = new CallManager();

		TransferCall result = fixture.take();

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Perform pre-test initialization.
	 *
	 * @throws Exception
	 *         if the initialization fails for some reason
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@Before
	public void setUp()
		throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 *
	 * @throws Exception
	 *         if the clean-up fails for some reason
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	@After
	public void tearDown()
		throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Launch the test.
	 *
	 * @param args the command line arguments
	 *
	 * @generatedBy CodePro at 11-5-7 上午2:46
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(CallManagerTest.class);
	}
}